AccountServiceImplementation

@Singleton
class AccountServiceImplementation @Inject constructor(firebaseAuth: FirebaseAuth, firestore: FirebaseFirestore) : AccountService

Implementation of AccountService that interacts with Firebase for user authentication and account management.

Constructors

Link copied to clipboard
@Inject
constructor(firebaseAuth: FirebaseAuth, firestore: FirebaseFirestore)

Functions

Link copied to clipboard
open override fun authenticate(email: String, password: String, onResult: (Throwable?) -> Unit)

Authenticate a user with their email and password. This logs the user into their account.

Link copied to clipboard
open override fun createAccount(email: String, password: String, onResult: (Throwable?) -> Unit)

Create a new account using the provided email and password. This registers a new user with the specified email and password.

Link copied to clipboard
open override fun createAnonymousAccount(onResult: (Throwable?) -> Unit)

Create an anonymous account for the user. This signs the user in anonymously.

Link copied to clipboard
open override fun linkAccount(email: String, password: String, onResult: (Throwable?) -> Unit)

Link the current account to a new email and password. This allows the user to associate an email and password with their account.

Link copied to clipboard
open override fun logout(onResult: (Throwable?) -> Unit)

Log out the currently authenticated user. This signs the user out and clears their session.